<%-- 
    Document   : ListSubmit
    Created on : 23/04/2011, 04:20:38 PM
    Author     : Jhon
--%>
<%@page import="vo.VOSubmission"%>
<%@page import="java.util.ArrayList"%>
<%@page import="util.EnumSearchParameter"%>
<%@page import="java.util.List"%>
<%@page import="vo.VOProblem"%>
<%@page import="control.Controller"%>
<%@page import="vo.VOUser"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="HTML.*"%>
<%@include file="CheckSession.jsp"%>
<% HtmlBody b = new HtmlBody("My Submissions","");
   HtmlContent c = new HtmlContent("My Submissions");
   VOUser a = (VOUser) session.getAttribute("USER");
   if(a.isIsAdmin()){
   b.addUsuario(a.getHandle(), "Administrator");
   c.addStoryProblem();
   }else{
   b.addUsuario(a.getHandle(), "User");
   }
   HtmlSideBar s = new HtmlSideBar(true);
   String[] datos ={"Date","Language","Verdict","Problem","Contest"};
   c.addInitLista("Submissions","600", datos);
   Controller con = Controller.getInstance();

   ArrayList<VOSubmission> list = con.listSubmissions(EnumSearchParameter.USER, a);
   if(list!=null && !list.isEmpty())
   for(VOSubmission p:list){
    datos[0]=p.getDate().toString();
    datos[1]=p.getLanguage();
    datos[2]=p.getVerdict();
    datos[4]=p.getProblemCode();
    datos[5]=p.getContestCode();
    c.addDataLista(datos);
   }
   c.addEndLista();
   b.addContent(c.getContent());
   b.addSideBar(s.getBar());
    %>

    <%=b.getHtml()%>
